package com.aecc.ds.demo.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.aecc.ds.demo.entity.Goods;
import com.aecc.ds.demo.mapper.GoodsMapper;
import com.aecc.ds.demo.service.IGoodsService;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author CodeGenerator
 * @since 2020-11-11
 */
@Service
@DS("sharding")
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {

	/**
	 * 使用主数据源，不走shardingjdbc数据源
	 */
	@DS("master")
	@Override
	public int addSingleTable(Goods goods) {
		// TODO Auto-generated method stub
		return this.baseMapper.addSingleTable(goods);
	}

	/**
	 * 不支持having改走master数据源
	 */
	@DS("master")
	@Override
	public List<Map<String, Object>> getTypeCountList() {
		// TODO Auto-generated method stub
		return this.baseMapper.getTypeCountList();
	}
		
}
